<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="net.netca.gdltax.bpms.webservice.*"%>
<%@page import="net.netca.gdltax.bpms.businessmanage.bo.*"%>
<%@page import="java.util.*"%>
<%@page import="net.netca.gdltax.bpms.businessmanage.utilits.Base64Encoder"%>
<%@page import="net.netca.bmps.userservice.bo.*"%>
<%@page import="net.netca.bmps.userservice.service.*"%>
<%@page import="net.netca.bmps.userservice.servicelayer.*"%>
<%@page import="net.netca.bmps.userservice.bo.CertInfoLocal"%>
<%@page import="net.netca.bmps.userservice.service.UserService"%>
<%@page import="net.netca.bmps.userservice.servicelayer.UserServiceImpl"%>
<%@page import="net.netca.gdltax.bpms.businessmanage.utilits.*"%>
<%@page import="net.netca.util.encoders.Base64"%>
<%@page import="java.security.cert.X509Certificate"%>
<%@page import="net.netca.testwebservice.bo.XMLConfig"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<%
	//CertServiceClient client = new CertServiceClient(
	//		"http://192.168.0.37:8082/businessmanage/services/CertService");
	CertServiceClient client = new CertServiceClient(
			XMLConfig.getInstance().getUrl());
	CertServicePortType service = client.getCertServiceHttpPort();
	List<CA> cas = service.getAllCA().getCA();
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="./jsp/resource/css/netca2.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="<%=basePath%>dwr/interface/UserServiceImpl.js"></script>
		<script src="getp10.js"></script>
	
	<title>证书制作</title>
	</head>
	<body>
		<h3 align="center">证书制证</h3>
		<form name="makeCertForm" id="makeCertForm" action="servlet/ReqAndInstall" method="post">
			<strong>请先插入需要制证证书的KEY</strong>
			<br>
			CA名称：
			<input name="caname" id="caname" value="广东省电子商务认证中心">
			<br>
			纳税人名称：
			<input name="name" id="name">
			<br>
			纳税人编号：
			<input name="taxpayerid" id="taxpayerid">
			<br>
			子用户编号：
			<input name="subuserid" id="subuserid">
			<br>
			有&nbsp效&nbsp期：
			<input name="validity" id="validity">
			<br>
			是否网报用户：是
			<input type="radio" name="iswebuser" id="iswebuser" value="1">
			否
			<input type="radio" name="iswebuser" id="iswebuser" value="0"
				checked="true">
			<br>
			ca编号：
			<br>
			<%
				for (int i = 0; i < cas.size(); i++) {
			%>
			<input type="radio" name="caid" id="caid"
				value="<%=cas.get(i).getId()%>" <%=i == 0 ? "checked" : ""%>><%=cas.get(i).getName().getValue()%>
			<br>
			<%
				}
			%>

			<br>
			P10(只读）:<input id="p10" name="p10" type="text" readonly value="">
			<br>
			证书类型(只读）：
			<input name="keytype" id="keytype" readonly>
			<br>
			证书介质编号(只读）：
			<input name="keysn" id="keysn" readonly>
			<br>
			<input type="hidden" id="soPin" name="soPin"  value="" >
			<input type="hidden" id="userPin" name="userPin" value="" >
			
			<input type="submit" id="reqAndInstall"  value="制证" onclick="getp10(document.getElementById('caname').value,'p10','keytype','keysn',getdn('',document.getElementById('name').value,'',document.getElementById('name').value,'','Guangdong','CN'))" class="colorCCC2" style="width: 100px">
 		</form>
	</body>
</html>